package com.wicket.okrbff.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrbff.biz.service.WeightTargetService;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrcomponent.integration.FwCompConfSchemeClient;
import com.wicket.okrapp.integration.FwAppWeightTargetClient;
import com.wicket.okrcomponent.integration.dto.QuerySchemeClassMatchEvaTempAnswerDetailComRespDto;
import com.wicket.okrcomponent.integration.dto.QuerySchemeClassMatchEvaTempAnswerDetailComReqDto;
import com.wicket.okrapp.integration.dto.ImplementAutoCountAverageWeightComRespDto;
import com.wicket.okrapp.integration.dto.ImplementAutoCountAverageWeightComReqDto;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrapp.integration.dto.QuerySuperiorTargetCycleWeightListRespDto;
import com.wicket.okrapp.integration.dto.QuerySuperiorTargetCycleWeightListReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffEvaObjTargetCycleWeightDto;
import java.util.stream.Collectors;
import com.wicket.okrbff.common.util.CommonFunctionHelper;
import com.wicket.okrapp.integration.dto.QuerySubordinateTargetCycleWeightListRespDto;
import com.wicket.okrapp.integration.dto.QuerySubordinateTargetCycleWeightListReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComReqDto;
import com.wicket.okrframework.integration.FwBaseOrgClient;
import com.wicket.okrframework.integration.dto.BatchQueryDeptComBorderRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryDeptComBorderReqDto;
import com.wicket.okrcomponent.integration.dto.QueryClassMatchResultToAnswerDetailComRespDto;
import com.wicket.okrcomponent.integration.dto.QueryClassMatchResultToAnswerDetailComReqDto;
import cn.hutool.core.collection.CollectionUtil;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "WeightTarget", tags = { "WeightTarget" })
@RestController
// @RequestMapping("/oms/weightTarget/")
public class WeightTargetController {

  @Autowired
  WeightTargetService weightTargetService;
/**
   * B3执行一键自动计算平均权重(管理)
   * gen by moon at 10/21/2023, 3:30:40 PM
   */
    @PostMapping("/oms/mgt/weightTarget/implementAutoCountAverageWeight")
    @ApiOperation(value = "B3执行一键自动计算平均权重(管理)", response = OkrResult.class)
    public OkrResult<BffImplementAutoCountAverageWeightRespDto> implementAutoCountAverageWeight(@RequestBody(required=false) @Validated BffImplementAutoCountAverageWeightReqDto reqDTO){
        return OkrResult.success(weightTargetService.implementAutoCountAverageWeight(reqDTO));
    }
/**
   * B3查询上级目标周期权重列表(管理)
   * gen by moon at 6/16/2024, 3:16:30 AM
   */
    @PostMapping("/oms/mgt/weightTarget/querySuperiorTargetCycleWeightList")
    @ApiOperation(value = "B3查询上级目标周期权重列表(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySuperiorTargetCycleWeightListRespDto> querySuperiorTargetCycleWeightList(@RequestBody(required=false) @Validated BffQuerySuperiorTargetCycleWeightListReqDto reqDTO){
        return OkrResult.success(weightTargetService.querySuperiorTargetCycleWeightList(reqDTO));
    }
/**
   * B3查询下级目标周期权重列表(管理)
   * gen by moon at 6/16/2024, 3:16:38 AM
   */
    @PostMapping("/oms/mgt/weightTarget/querySubordinateTargetCycleWeightList")
    @ApiOperation(value = "B3查询下级目标周期权重列表(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySubordinateTargetCycleWeightListRespDto> querySubordinateTargetCycleWeightList(@RequestBody(required=false) @Validated BffQuerySubordinateTargetCycleWeightListReqDto reqDTO){
        return OkrResult.success(weightTargetService.querySubordinateTargetCycleWeightList(reqDTO));
    }
}
